package com.example.shop_2305.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.lib_base.entity.CouponEntityItem
import com.example.shop_2305.R

class CouponAdapter:BaseQuickAdapter<CouponEntityItem,BaseViewHolder>(R.layout.item_coupon) {
    override fun convert(holder: BaseViewHolder, item: CouponEntityItem) {
        holder.setText(R.id.coupon_money,item.money)
        holder.setText(R.id.coupon_min,"满${item.minPrice}元可用")
        holder.getView<TextView>(R.id.coupon_get).text = if(item.isUse) "已领取" else "领取"

      /*  if(item.isUse){
            holder.setText(R.id.coupon_get,"已领取")
        }else{
            holder.setText(R.id.coupon_get,"领取")
        }*/
    }
}